package com.js.basic.api.factory;

import com.js.basic.api.RemoteBasicService;

import com.js.basic.api.model.CodeRules;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.aspectj.weaver.loadtime.Aj;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteBasicFallbackFactory implements FallbackFactory<RemoteBasicService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteBasicFallbackFactory.class);


    @Override
    public RemoteBasicService create(Throwable throwable) {
        log.error("编码格式调用失败:{}", throwable.getMessage());
        return new RemoteBasicService() {
            @Override
            public CodeRules getCodeByTableName(String tableName) {
                return null;
            }

            @Override
            public AjaxResult updateCodeNowByTableName(CodeRules codeRules) {
                return null;
            }
        };
    }
}
